package com.gin.kotlin.gf2gamecommunity.network.gitee.api

import com.gin.kotlin.gf2gamecommunity.network.gitee.response.AppRelease
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface ReleaseApi {
    /**
     * 获取仓库的所有Releases
     * [文档](https://gitee.com/api/v5/swagger#/getV5ReposOwnerRepoReleases)
     * @param owner 仓库所属空间地址
     * @param repo 仓库路径
     * @param page 页数
     * @param size 每页条数
     * @param direction 升序(asc) 或 降序(desc)
     * @return Call<List<AppRelease>>
     */
    @GET("repos/{owner}/{repo}/releases")
    fun list(
        @Path("owner") owner: String,
        @Path("repo") repo: String,
        @Query("page") page: Int = 1,
        @Query("per_page") size: Int = 20,
        @Query("direction") direction: String = "desc",
    ): Call<List<AppRelease>>
}